import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/lanling";

// 查询列表
export function listRobot(query) {
  return request({
    url: '/platform/robot/page',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getRobot(id) {
  return request({
    url: '/platform/robot/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增
export function addRobot(data) {
  return request({
    url: '/platform/robot',
    method: 'post',
    data: data
  })
}

// 修改
export function updateRobot(data) {
  return request({
    url: '/platform/robot',
    method: 'put',
    data: data
  })
}

// 机器人状态修改
export function changeRobotStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/platform/robot/changeStatus',
    method: 'put',
    data: data
  })
}
